import React, { Component } from "react";

export default class App extends Component {
  state = {
    loading: true,
  };
  componentDidMount() {
    setInterval(() => {
      this.setState({
        loading: false,
      });
    }, 3000);
  }

  render() {
    return (
      <div>
        <h3>龙魂宫</h3>
        <Gaojie0 loading={this.state.loading}></Gaojie0>
      </div>
    );
  }
}

class Moxing extends Component {
  render() {
    return <h3>林杨</h3>;
  }
}
let Gaojie0 = Gaojie(Moxing);
function Gaojie(Zujian) {
  return class extends Zujian {
    render() {
      if (this.props.loading) {
        return <h3>资源加载中</h3>;
      } else {
        return super.render();
      }
    }
  };
}
